//
//  BaseNavViewController.swift
//  weibo
//
//  Created by 上官风雨 on 15/11/16.
//  Copyright © 2015年 上官风雨. All rights reserved.
//

import UIKit

class BaseNavViewController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()
 
        
    }
    
    func back(){
        
        navigationController?.popViewControllerAnimated(true)
        
    }
    
    override func pushViewController(viewController: UIViewController, animated: Bool) {
        
        if self.childViewControllers.count != 0 {
            
            viewController.navigationItem.backBarButtonItem = UIBarButtonItem(title: "返回", style: .Plain, target: self, action: "back")
            viewController.hidesBottomBarWhenPushed = true
        }
        
       
        
        super.pushViewController(viewController, animated: true)
    }

   

   

}
